﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Antioch.Base.PlayerStates
{
    internal class Flinch : IState
    {
        public void Enter(StateMachine Machine)
        {
            Machine.DrawComponent.Play("Fall", true);
            Machine.PhysicsComponent.PhysicsBody.GetFixtureList().SetFriction(0.0f);
            Machine.PlayerEntity.GetComponent<Health>().Vulnerable = false;
            Machine.Memory.InvulnerableTime = 15;
        }

        public void Leave(StateMachine Machine)
        {
        }

        public void Update(StateMachine Machine)
        {
            if (Machine.TimeInState > 10) Machine.Transition(typeof(Stand));
        }
    }
}
